Improve photo and timezone sync scheduled task#3210
Open
weilai-irl wants to merge 1 commit into
Open
Conversation
weilai-irl
commented
Jun 4, 2026
Collaborator
- Better support for site not using UPN as username,
- Reduce DB queries.
There was a problem hiding this comment.
Pull request overview
This PR improves the photoandtimezonesync scheduled task to better handle environments where o365name is not a valid Microsoft Graph user identifier, and to reduce per-user DB/API work during photo sync runs.
Changes:
- Use Entra
objectid(GUID) as the identifier for Graph photo batch requests instead ofo365name/UPN. - Reduce DB overhead by replacing per-user
local_o365_appassignlookups with a pre-aggregated LEFT JOIN, and by caching/storing a raw-photo hash inuser_preferencesto skip unnecessary image processing. - Refine photo-apply semantics by returning a boolean from
apply_photo_public()and improving change detection inapply_photo().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| local/o365/classes/task/photoandtimezonesync.php | Switch photo batch lookup to objectid, reduce DB queries, and add hash-based short-circuiting for unchanged photos. |
| local/o365/classes/feature/usersync/main.php | Improve photo-apply “changed” detection and return a boolean from apply_photo_public() for scheduled task use. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
75cb88c to
75625d2
Compare
…r site not using UPN as username, reduce DB queries
75625d2 to
e2c21d1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.